<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>循环</title>
</head>
<body>
    <script>
        var i = 1;
        var j = 0;
        do {
            j = i + j;
            i++;
        } while (i <= 1000);
        console.log(j);
    </script>
</body>
</html>